import request from '@/utils/request'

export function fetchAppropriationList() {
  return request({
    url: '/appropriations',
    method: 'get'
  })
}

export function fetchApprovedAppropriationList() {
  return request({
    url: '/appropriations/approved',
    method: 'get'
  })
}

export function fetchAppropriationById(id) {
  return request({
    url: `/appropriations/${id}`,
    method: 'get'
  })
}

export function createAppropriation(data) {
  return request({
    url: '/appropriations',
    method: 'post',
    data
  })
}

export function updateAppropriation(id, data) {
  return request({
    url: `/appropriations/${id}`,
    method: 'put',
    data
  })
}

export function deleteAppropriation(id) {
    return request({
      url: `/appropriations/${id}`,
      method: 'delete'
    })
}
  
